home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
4dostool
/
tfc22c.zip
/
FIX.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-11-03
|
2KB
|
127 lines
{ This unit prevents TV from Resetting the screen mode at start up
thus allowing to work with resolutions like 100x40
__ Robert Juhasz | University of Paderborn
\_\ Ludwigstr. 16 | Department of Maths & CS
__ 4790 Paderborn | Fachbereich 17
_____ \ \ Germany |
/ /___)_\ \ |
/_/ \_\ \___) robertj@uni-paderborn.de |}
unit Fix;
interface
uses
dos;
procedure InitFix;
procedure DoneFix;
implementation
var
OldInt10,
OldExit : Pointer;
VMode : Byte absolute $0:$449; { BIOS video mode }
const
Installed: Boolean = false;
procedure ChainInt(OldInt:Pointer);
inline($5b/$58/
$89/$ec/
$87/$46/$10/
$87/$5e/$0e/
$5d/$07/$1f/
$5f/$5e/$5a/$59/
$cb);
procedure FixMode(ax,bx,cx,dx,si,di,ds,es,bp:Word);Interrupt;
begin
if Hi(ax)=0 then ax:=Word( VMode );
ChainInt(OldInt10)
end;
procedure InitFix;
begin
if not Installed
then begin
Installed := true;
GetIntVec($10,OldInt10);
SetIntVec($10,@FixMode)
end
end;
procedure DoneFix;
begin
if Installed
then begin
Installed := false;
SetIntVec($10,OldInt10)
end
end;
procedure AtExit; far;
begin
ExitProc := OldExit;
DoneFix
end;
begin
OldExit := ExitProc;
ExitProc := @AtExit;
end.
{ Use it like the next demo:
{USEFIX.PAS}
program USEFIX;
uses
Dos, Objects, App, Fix;
var
MyApp: TApplication;
(*
* GetArgs: Commando-Zeile.
*)
function GetArgs: PString;
const
S: String = '';
begin
S := String( Ptr(PrefixSeg,$80)^ ); { lieber kopieren }
GetArgs := @S;
end;
begin
InitFix; { Fix ist nur wdhrend der }
MyApp.Init; { Initialisierung aktiv! }
DoneFix;
MyApp.Run;
MyApp.Done;
(*
{Alternativ:}
if (GetEnv('FIX')<>'') or
( Pos('/F', GetArgs^)<>0 ) or
( Pos('/f', GetArgs^)<>0 )
then
InitFix;
MyApp.Init;
DoneFix;
MyApp.Run;
MyApp.Done;
*)
end.
}